package com.lbh.cloudgallery.front;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lbh.cloudgallery.entity.OrderEntity;
import com.lbh.cloudgallery.entity.OrderItemEntity;
import com.lbh.cloudgallery.service.OrderItemService;
import com.xxx.common.utils.PageUtils;
import com.xxx.common.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;
import java.util.Map;


/**
 * 
 *
 * @author 廖碧涵
 * @email lbh@qq.com
 * @date 2021-02-25 22:47:51
 */
@Api(tags = "订单项")
@RestController
@RequestMapping("front/orderitem")
public class FrontOrderItemController {
    @Autowired
    private OrderItemService orderItemService;

    @ApiOperation(value = "查询订单详情")
    @GetMapping("/orderItemList/{orderId}")
    public R orderItemList(@PathVariable("orderId") Long orderId){

        List<OrderItemEntity> orderItemEntities = orderItemService
                .list(new QueryWrapper<OrderItemEntity>()
                        .eq("order_id", orderId));

        return R.ok().put("items",orderItemEntities);
    }
}
